RippleVoicePulser{

	var running = false, parent, forEverRoutine, patternStartFn;

	*new{|parentArg|
		^super.new.init(parentArg);
	}
	
	init{|parentArg|
		this.setRoutines;
		parent = parentArg;
	}

	start{
		parent.playSound;
		forEverRoutine.start;
		running = true;
	}
	
	reset{
		if(this.isRunning){
			forEverRoutine.stop;
			this.setRoutines;
			forEverRoutine.start;		
			
		}
	}
	
	isRunning{
		^running
	}
	
	pause{
		forEverRoutine.stop;
		running = false;
	}
	
	playOnce{
		parent.playSound;
	}
	
	setPatternStartFn{|fnArg|
		patternStartFn = fnArg;
	}
	
	setControlValue{|name, val| // if the frequency changed, we'll want to update
		if(name == \triggerFreq){
			this.reset;	
		}
	}
	
	setRoutines{
		forEverRoutine = Task.new({			
			while( {true},
			{
				(1/parent.getCachedControlValue(\triggerFreq)).yield;
				parent.playSound;
				
			});
			
		});	
	}
}